<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的屏蔽</title>
    <link rel="icon" href="/hire/imgs/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/hire/css/common/nav_left.css">
    <link rel="stylesheet" href="/hire/css/user/center/myblacklist.css">
<%--    <link rel="stylesheet" href="/hire/plugins/bootstrap/css/bootstrap.css">--%>
    <link rel="stylesheet" href="/hire/plugins/layui/css/layui.css">
</head>

<body>
<%@include file="../../common/mynav.jsp"%>
<div class="middler">
    <div class="inner">
        <div class="left">
            <div class="menu-list">
                <ul class="menu">
                    <li><a href="/hire/user/employee_info">个人中心</a></li>
                    <li><a href="/hire/user/resume_center">简历中心</a></li>
                    <li><a href="/hire/user/resume_view">谁看过我</a></li>
                    <li><a href="/hire/user/mydelivery">我的投递</a></li>
                    <li><a href="/hire/user/mycollection">我的收藏</a></li>
                    <li class="active"><a href="/hire/user/myblacklist">我的屏蔽</a></li>
                    <li><a href="/hire/user/account_settings">账号设置</a></li>
                </ul>
            </div>
        </div>
        <div class="right">
            <div class="title">
                <h2>我的屏蔽</h2>
            </div>
        </div>
        <div class="big">
            <div class="layui-anim layui-anim-up">

                <table class="layui-table" lay-size="lg" lay-skin="line" style="background-color: white;">
                    <colgroup>
                        <col width="400">
                        <col width="400">
                        <col width="200">

                    </colgroup>
                    <thead>
                    <tr>
                        <th>公司名</th>
                        <th>工作地点</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>


                    <c:forEach items="${companyList}" var="c">
                        <div class="col-md-12">
                                    <tr>
                                        <td><input type="checkbox" name="cks"><a href="/hire/job/company/companyinfo?id=${c.id}">${c.name}</a></td>
                                        <td>${c.city}${c.district}</td>
                                        <td><button type="button" onclick="dele(${c.id})" style="background-color: white;border: 0">取消屏蔽</button></td>
                                    </tr>
                        </div>
                    </c:forEach>
<%--                    <tr>--%>
<%--                        <td><input type="checkbox" name="" onclick="selectAll(this)">全选</td>--%>
<%--                        <td></td>--%>
<%--                        <td>--%>
<%--                            <div class="op">--%>
<%--                                <span><button type="button">取消屏蔽</button></span>--%>
<%--                            </div>--%>
<%--                        </td>--%>
<%--                    </tr>--%>
                    </tbody>
                </table>
            </div>
        </div>
<%--        <div id="demo0" style="position: absolute;top: 480px;right: 500px"></div>--%>

    </div>
</div>
<script src="/hire/plugins/jquery/jquery.min.js"></script>
<script src="/hire/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/hire/plugins/layui/layui.js"></script>
<script>
        function dele(id){
            $.post('/hire/user/delete/blacklist',{cid:id} ,function(res){
                if (res.code == '200') {
                    layer.msg("删除成功")
                    location.reload();
                } else {
                    layer.msg("删除失败")
                }
            });
    }




    let tbody = document.getElementById("tb");
    let count = 0;

    function selectAll(obj) {
        //1. 获取下面所有的checkbox
        let cks = document.getElementsByName("cks");

        if (obj.checked) {
            for (let i = 0; i < cks.length; i++) {
                cks[i].checked = true;
            }
        } else {
            for (let i = 0; i < cks.length; i++) {
                cks[i].checked = false;
            }
        }
    }


</script>

<script>
    <%--})--%>
    layui.use(['laypage', 'layer'], function () {
        var laypage = layui.laypage
            , layer = layui.layer;

        //总页数低于页码总数
        laypage.render({
            elem: 'demo0'
            , count: 50 //数据总数
        });
    });
</script>
<%@include file="../../common/myfooter.jsp" %>
</body>
</html>